<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>跟车裁判测评展示平台</title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <!-- Custom CSS -->
    <!-- Morris Charts CSS -->
    <link href="css/plugins/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/plug-ins/28e7751dbec/integration/bootstrap/3/dataTables.bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_i0327076nave7b9.css"/>
    <link href="nuget/content/content/toastr.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="css/datatable.css"/>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>

<body>
	<div id="bg">
		<div class="panel-heading">
			<div class="login-logo">
				2017 · 中国智能车 - 未来挑战赛 · 比赛成绩汇总
			</div>
		</div>
		<div class="panel-body">
		    <table id="example" class="display" width="100%"></table>
		</div>
	</div>
    <!-- jQuery -->
    <script src="js/jquery.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>
	<!-- tab table-->
	<script src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
	<script src="http://cdn.datatables.net/plug-ins/28e7751dbec/integration/bootstrap/3/dataTables.bootstrap.js"></script>
	<!-- device-->
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/vue/vue.js" ></script>
	<script type="text/javascript" src="js/vue/vue-router.js" ></script>
	<script>
		Vue.filter("timeChange", function(value) {
			return replaceTime(value / 1000);
		});
		var vue = new Vue({
		  el: '#bg',
		  data:{
		  	
		  },
		  mounted:function(){
		  	this.deviceBasicId();
		  },
		  methods:{
		  	//初始化显示详情
		  	deviceBasicId:function(){
		  		var _self = this;
				var myTable = $('#example').DataTable({
				    "processing": false, //DataTables载入数据时，是否显示‘进度’提示
		            "stateSave": true, //是否打开客户端状态记录功能,此功能在ajax刷新纪录的时候不会将个性化设定回复为初始化状态
		            "scrollCollapse": true, //是否开启DataTables的高度自适应，当数据条数不够分页数据条数的时候，插件高度是否随数据条数而改变
		            "paginationType": "full_numbers", //详细分页组，可以支持直接跳转到某页
		            "language": lang, //提示信息
		            "autoWidth": true, //自适应宽度，
		            "lengthMenu": [8, 30, 50],
		            "showRowNumber":true,
		            "searching": false, //是否允许Datatables开启本地搜索
		            "paging": false, //是否开启本地分页
		            "lengthChange": false, //是否允许产品改变表格每页显示的记录数
		            "info": false, //控制是否显示表格左下角的信息
		            //跟数组下标一样，第一列从0开始，这里表格初始化时，第四列默认降序
		            "ordering": false,
		            "deferRender": true, //延迟渲染
		            //"ajax":"json/device.json",
				    "ajax": {
				      	url :url+'/users/'+adminId+'/stadiumResultDetails',
						type : 'get',
						dataType : 'json',
						beforeSend: function(request) {
				            request.setRequestHeader("accessToken", accessToken);
				        },
						success : function(data) {
							if(data['code'] == 1){
		                        if(data.result.length != 0)
		                            $('#example').dataTable().fnAddData(data.result);
		                        else
		                            $('#example').dataTable().fnClearTable();
		                    }else{
								ifajax(data);
							}
						}
				      }, 

			      "columns": [{ //定义列
				        "data":"riwso",
				        "width":"50px",
				        "render":function(data, type, full, meta ){
				        	return (meta.row+1);
				        },
				        "sTitle": "排名", //标题
				        "sDefaultContent": "", //此列默认值为""，以防数据中没有此值，DataTables加载数据的时候报错  
				    },{
		                "data": "teamName",
		                "sTitle": "车队",
		                "sDefaultContent": "",
		            }, {
		                "data": "teamOrganization",
		                "sTitle": "参赛单位",
		                "sDefaultContent": "",
		            },{
		                "data": "stadium2Time",
		                "sTitle": "高速比赛时间",
		                "sDefaultContent": "",
		            },{
				      	"data": function(obj){
				            return obj.stadium2Score+'分';
				        },
				      	"sTitle":"高速比赛成绩",
				      	"sDefaultContent": "", 
				    },{
		                "data": "stadium1Time",
		                "sTitle": "九宫格比赛时间",
		                "sDefaultContent": "",
		            },{
				      	"data": function(obj){
				            return obj.stadium1Score+'分';
				        },
				      	"sTitle":"九宫格比赛成绩",
				      	"sDefaultContent": "", 
				    },{
				      	"data": function(obj){
				            return obj.totalScore+'分';
				        },
				      	"sTitle":"总成绩",
				      	"sDefaultContent": "", 
				    }],
			    });
		  	},
		  	
		  },
		});

	</script>
</body>

</html>
